﻿@using Webdiyer.WebControls.Mvc
@model PagedList<Dyd.BusinessMQ.Domain.Model.tb_partition_model>
@{
    ViewBag.Title = "表分区管理";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Scripts{
    @{Html.RegisterMvcPagerScriptResource();}
}
<script>
    function Delete(id) {
        if (confirm("确定删除吗？")) {
            $.ajax({
                url: '@Url.Action("Delete", "Partition")',
                type: "post",
                data: {
                    partitionId: id
                },
                success: function (data) {
                    if (data.code > 0) {
                        alert("成功！");
                        window.location = window.location;
                    }
                    else {
                        alert(data.msg);
                    }
                }
            })
        }
    }
</script>
<div class="head">
    <div class="title">
        表分区管理 @Html.Raw(Dyd.BusinessMQ.Web.Base.CommonHelper.Help(@"数据库节点下面表分区的管理,注意:删除分区,需确认表未被队列使用。分区删除仅移除分区和节点的关系，并不会删除实际的消息数据。
分区编号命名规则:1+分区节点+表分区编号"))
    </div>
</div>
<div class="orderlist m10 myorder">
 
        @using (Html.BeginForm("Index", "Partition", FormMethod.Get, new RouteValueDictionary { { "id", "searchForm" } }))      
    {
        <div class="item_list pt10">
            <div class="item_list">
                <ul>
                    <li>
                        <label>分区编号</label><input type="text" class="text midtext" style="width:150px;" name="partitionid" value="@ViewBag.partitionid" />
                        <label>节点编号</label><select name="nodeid">
                            <option @(ViewBag.nodeId==""?"selected='selected'":"") value="">选择</option>
                          @foreach (var o in ViewBag.Nodes)
                          { <option @(ViewBag.nodeId==o?"selected='selected'":"") value="@o">@o</option>}
                                           </select>
                         <label>使用状态</label><select name="used">
                            <option @(ViewBag.used==-1?"selected='selected'":"") value="-1">选择</option>
                            <option @(ViewBag.used==0?"selected='selected'":"") value="0">未使用</option>
                            <option @(ViewBag.used==1?"selected='selected'":"") value="1">已使用</option>
                                           </select>
                    </li>

                    <li class="search">
                        <input type="submit" class="btn1" value="搜索" accesskey="S" /></li>
                </ul>
            </div>
        </div>
    }
       <a href="@Url.Action("Add", "Partition", new { nodeId=ViewBag.nodeId})" class="btn1">新增</a>
   <div class="List">
            @Html.Partial("List",Model)
        </div>
</div>